/*！
 * 自定义扩展特征抹除脚本
 */
(function () {
    //1.绕开CDP检测
    window.console.debug = () => {
    };
    //2.绕开Selenium检测
    let objectToInspect = window, result = [];
    while (objectToInspect !== null) {
        result = result.concat(Object.getOwnPropertyNames(objectToInspect));
        objectToInspect = Object.getPrototypeOf(objectToInspect);
    }
    let f = result.filter(i => i.match(/.+_.+_(Array|Promise|Symbol)/ig));
    if (f != null && !f.isEmpty()) {
        let objectToInspect = window, result = [];
        while (objectToInspect !== null) {
            result = result.concat(Object.getOwnPropertyNames(objectToInspect));
            objectToInspect = Object.getPrototypeOf(objectToInspect);
        }
        result.forEach(p => p.match(/.+_.+_(Array|Promise|Symbol)/ig) && delete window[p] && console.log('removed', p));
    }
})();
